<?php
InitGP(array("status",'action','gid','status')); //初始化变量全局返回
include_once(INC_PATH."/goodsforecast.class.php");
$g = new GoodsForecastClass();
$uid = $_USERS['uid'];
if($action == 'edit'){
	$good = $g->getone($gid);
	if($good && ($good['uid'] == $uid)){
		//支付、收货、评论 可以进行修改
		if($good['status'] == 3){
			include template('member_depotlist_pay');//包含输出指定模板
		}
	}else{
		showmsg('没有权利修改', $gourl);
	}
}else if($action == 'pay'){
	$good = $g->getone($gid);
	if($good){
		include_once(INC_PATH."/member.class.php");
		$m=new memberclass();
		$note = '支付运费 '.$good['ex'];
		$rs = $m->moneyedit($_USERS['uname'],-1*$good['price'],2,$note);
		if($rs == 'OK'){
			$g->editStatus($gid, 4);
			showmsg($good['ex'].'支付成功', '?name=depotlist');
		}
	}
}else{
	$pagesize=5;												  //一页显示信息数
	$page = isset($page) ? max(1, intval($page)) : 1;             //处理页码变量
	$offset=($page-1)*$pagesize;
	$where = ' O.uid = '.$uid;
	if($status){
		$where .= ' AND O.status = '.$status;
	}
	$exlist = $g->getuserdata("$offset,$pagesize", $where);
	foreach($exlist as $key=>$ex){
		$exlist[$key]['status_info'] = $g->getStatusInfo($ex['status']);
	}
	include template('member_myde');//包含输出指定模板
}
?>